home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / art&graf.ix / art-0014 / extra / user.c < prev    next >
Text File  |  1997-04-16  |  3KB  |  146 lines

  1.  
  2. #include "portab.h"
  3.  
  4. int contrl[12], intin[256], ptsin[256], intout[256], ptsout[256];
  5.  
  6. main()
  7. {
  8.   int l_intin[20], l_ptsin[20], l_out[100], pxy[2], ptemp[1];
  9.   int handle, i, j, k, l, x1, x2, xcen, xres, y1, y2, ycen, yres;
  10.   int color, max_color;
  11.   int gr_1,gr_2,gr_3,gr_4;
  12.   int mxin,myin,mwin,mhin,mxout,myout,mbout,ksout;
  13.   int aspect,planes;
  14.   int filpat[65];
  15.  
  16. /* Set the system up to do GEM calls*/
  17.  
  18.   appl_init();
  19.  
  20. /* Get the handle of the desktop */
  21.  
  22. handle=graf_handle(&gr_1,&gr_2,&gr_3,&gr_4);
  23.  
  24.  
  25. /* define multi plane pattern */
  26.   filpat[0]=0x0000;
  27.   filpat[1]=0x0000;
  28.   filpat[2]=0x0000;
  29.   filpat[3]=0x0000;
  30.   filpat[4]=0x0000;
  31.   filpat[5]=0x0000;
  32.   filpat[6]=0x0000;
  33.   filpat[7]=0x0000;
  34.   filpat[8]=0xffff;
  35.   filpat[9]=0xffff;
  36.   filpat[10]=0xffff;
  37.   filpat[11]=0xffff;
  38.   filpat[12]=0xffff;
  39.   filpat[13]=0xffff;
  40.   filpat[14]=0xffff;
  41.   filpat[15]=0xffff;
  42.  
  43.   filpat[16]=0x00ff;
  44.   filpat[17]=0x00ff;
  45.   filpat[18]=0x00ff;
  46.   filpat[19]=0x00ff;
  47.   filpat[20]=0x00ff;
  48.   filpat[21]=0x00ff;
  49.   filpat[22]=0x00ff;
  50.   filpat[23]=0x00ff;
  51.   filpat[24]=0xff00;
  52.   filpat[25]=0xff00;
  53.   filpat[26]=0xff00;
  54.   filpat[27]=0xff00;
  55.   filpat[28]=0xff00;
  56.   filpat[29]=0xff00;
  57.   filpat[30]=0xff00;
  58.   filpat[31]=0xff00;
  59.  
  60.   filpat[32]=0x0000;
  61.   filpat[33]=0x0000;
  62.   filpat[34]=0x0000;
  63.   filpat[35]=0x0000;
  64.   filpat[36]=0xffff;
  65.   filpat[37]=0xffff;
  66.   filpat[38]=0xffff;
  67.   filpat[39]=0xffff;
  68.   filpat[40]=0x0000;
  69.   filpat[41]=0x0000;
  70.   filpat[42]=0x0000;
  71.   filpat[43]=0x0000;
  72.   filpat[44]=0xffff;
  73.   filpat[45]=0xffff;
  74.   filpat[46]=0xffff;
  75.   filpat[47]=0xffff;
  76.  
  77.   filpat[48]=0xf0f0;
  78.   filpat[49]=0xf0f0;
  79.   filpat[50]=0xf0f0;
  80.   filpat[51]=0xf0f0;
  81.   filpat[52]=0xf0f0;
  82.   filpat[53]=0xf0f0;
  83.   filpat[54]=0xf0f0;
  84.   filpat[55]=0xf0f0;
  85.   filpat[56]=0xf0f0;
  86.   filpat[57]=0xf0f0;
  87.   filpat[58]=0xf0f0;
  88.   filpat[59]=0xf0f0;
  89.   filpat[60]=0xf0f0;
  90.   filpat[61]=0xf0f0;
  91.   filpat[62]=0xf0f0;
  92.   filpat[63]=0xf0f0;
  93.  
  94.   /* Open the workstation. */
  95.  
  96.   for (i=1; i<10; ++i)  l_intin[i] = 1;
  97.   l_intin[10] = 2;
  98.  
  99.   v_opnvwk(l_intin, &handle, l_out);
  100.   xres=l_out[0];
  101.   yres=l_out[1];
  102.   aspect=l_out[4]/l_out[3];
  103.   mxin=0; myin=0; mwin=xres; mhin=yres;
  104.   vq_extnd(handle,1,l_out);
  105.   planes=l_out[4];
  106.  
  107.   v_hide_c(handle);
  108.   v_clrwk(handle);
  109.   v_show_c(handle,1);
  110.   evnt_keyb();
  111.   vsf_udpat(handle,filpat,planes);
  112.   vsf_interior(handle,4);
  113.   v_hide_c(handle);
  114.   v_circle(handle,xres/2,yres/2,yres/2*aspect);
  115.   v_show_c(handle);
  116.   evnt_keyb();
  117.   v_hide_c(handle);
  118.   vsf_interior(handle,2);
  119.   vsf_style(handle,9);
  120.   vsf_color(handle,1);
  121.   v_circle(handle,xres/2,yres/2,yres/2*aspect);
  122.   evnt_keyb();
  123.   v_hide_c(handle);
  124.   vsf_interior(handle,2);
  125.   vsf_style(handle,12);
  126.   v_circle(handle,xres/2,yres/2,yres/2*aspect);
  127.   vsf_interior(handle,4);
  128.   evnt_keyb();
  129.   v_contourfill(handle,xres/2,yres/2,1);
  130.   v_show_c(handle);
  131.  
  132.   graf_mouse(0,i);
  133.   
  134.   /* Close the workstation. */
  135.  
  136.   v_clsvwk(handle);
  137.  
  138.  /* Release GEM calls */
  139.  
  140.   appl_exit();
  141.  
  142. _exit(0);
  143.  
  144. }
  145.  
  146. ə